<template>
  <div id="course-learn-view">
    <NavBar type="learn"></NavBar>
    <main class="learn-main learn-layout flex-box">
      <div class="side card">
        <div class="course-cover"></div>
        <SideNav :menu="menu"></SideNav>
      </div>
      <div class="main card">
        <router-view></router-view>
      </div>
    </main>
  </div>
</template>

<script>
import NavBar from "_c/HeadNav";
import SideNav from "_c/SideNav";

export default {
  name: "CourseLearnView",
  components: { SideNav, NavBar },
  data() {
    return {
      menu: [
        {
          title: "课程公告",
          to: {
            name: "learn-notice",
          },
          page: ["learn-notice"],
        },
        {
          title: "章节目录",
          to: {
            name: "learn-content",
          },
          page: ["learn-content"],
        },
        {
          title: "课程测试",
          to: {
            name: "learn-test-list",
          },
          page: ["learn-test-list", "learn-test-detail"],
        },
        {
          title: "讨论区",
          to: {
            name: "learn-discussion-list",
          },
          page: ["learn-discussion-list", "learn-discussion-detail"],
        },
      ]
    };
  }
};
</script>

<style scoped lang="scss">

.side {
  flex-shrink: 0;
  // flex-basis: 160px;
  height: 300px;
  margin-right: 20px;
  border-radius: 10px;
  padding: 10px 0;
}

.main {
  flex: 1;
  padding: 20px;
  border-radius: 10px;
  min-height: 500px;
}

</style>
